﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using HotelSoft.HotelManagement_DTO;

namespace HotelSoft.HotelManagement_DAO
{
    class HeSo_TiLeDAO : AbstractDAO
    {
        HeSo_TiLeDTO dtoHeSo_TiLe = new HeSo_TiLeDTO();
        public static DataTable SelectAll()
        {
            string sql = "SELECT * FROM HESO_TILE";
            return Config.AccessHelper.ExecuteQuery(sql);
        }

        public static bool UpdatebangHESO_TILE(object AbstractDTO)
        {
            try
            {
                HeSo_TiLeDTO dto = (HeSo_TiLeDTO)AbstractDTO;
                string updateCommand = "UPDATE HESO_TILE SET  Ngayapdung = '" + dto.Ngayapdung.ToString("MM/dd/yyyy") + "' ,HS_KhachThu3 = '" + dto.HS_KhachThu3 + "',HS_KhachNcNgoai = '" + dto.HS_KhachNcNgoai + "'";
                Config.AccessHelper.ExecuteQuery(updateCommand);
                return true;
            }
            catch
            {
                return false;
            }
        }
        public override bool Them(object AbstractDTO)
        {
            return true;
        }
        public override void TraCuu(object AbstractDTO)
        {

        }

        public override bool CapNhatThongTin(object AbstractDTO)
        {
            return false;
        }
        public override void Xoa(object AbstractDTO)
        {
           
              
        }

    }
}
